<template>
<el-dialog
    v-if="visible"
    :close-on-click-modal="false"
    :visible.sync="visible"
    >
<gd-map-device  v-if="gdMmapDevicVisable" ref="gdMapDevice"></gd-map-device>
</el-dialog>
</template>

<script>
import gdMapDevice from "./gdMapDevice";
export default {
  data() {
    return {
      visible: false,
      gdMmapDevicVisable:true,
    };
  },
  components: {
    gdMapDevice
  },
  created(){
    // let self = this;
    //   let markers = [];
    //   let index = 0;

    //   let basePosition = [106.748648, 26.563406];
    //   let num = 10;

    //   for (let i = 0; i < num; i++) {
    //     markers.push({
    //       position: [basePosition[0], basePosition[1] + i * 0.03],
    //       template: `<el-button type="primary" @click.native="handler(${i})">{{ source }} ${i}</el-button>`
    //     });
    //   }
    //   this.markers = markers;
  },
  mounted() {
    // this.initSearch()
  },
  methods: {
    init(communityId){
      this.visible = true;
       this.$nextTick(() => {
          // 根据区域id获取设备表并且是带勾选的
          this.$refs.gdMapDevice.init(
            communityId
          );
        });
    }

  }
};
</script>

